<?php
header("Content-Type: text/html; charset=utf-8");
require_once '../setting/setting.php';
require_once '../smarty/Smarty.class.php';
require_once '../lib/query_railway.php';
require_once '../lib/base.php';
if($_POST["act"]=="modify") {
	$nick=urldecode($_POST["nick"]);
	$ps1=urldecode($_POST["ps1"]);
	$ps2=urldecode($_POST["ps2"]);	
	$name=urldecode($_POST["name"]);
	$cname=urldecode($_POST["cname"]);
	$cadd=urldecode($_POST["cadd"]);
	$tel=urldecode($_POST["tel"]);
	$qq=urldecode($_POST["qq"]);
	$msn=urldecode($_POST["msn"]);
	$uremark=urldecode($_POST["uremark"]);
	
	if(!$ps1 ||($ps1!=$ps2)){echo "确认密码输入错误，并且不能为空，请重新输入！";exit;}
	$check_station=QR::check_exist($tb_user,"nick='".$nick."'");
	if($check_station){echo "会员名已存在，请重新输入！";exit;}
	
	$data[0]="nick,ps,name,cname,cadd,tel,qq,msn,rg_time,uremark";
	$data[1]="'$nick','$ps1','$name','$cname','$cadd','$tel','$qq','$msn',NOW(),'$uremark'";		
	$op= QR::add_data($tb_user,$data);
	if($op>0)echo "100" ;else echo "添加失败，请检查输入的正确性！";
	exit;
}
//echo $start;
$smarty = new Smarty;
$smarty->display('user_register.tpl');

?>